//
//  ViewController.m
//  DFMediatorTest
//
//  Created by dafiger on 2020.04.12.
//  Copyright © 2020 dafiger. All rights reserved.
//

#import "ViewController.h"

#import <DFMediator/DFMediator.h>
#import <DFMediator/DFMediatorTestAProtocol.h>

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor lightGrayColor];
    
    [self performSelector:@selector(jumpA) withObject:nil afterDelay:2.0f];
    // Do any additional setup after loading the view.
}

- (void)jumpA {
    id obj = [DFMediator moduleInstanceFromProtocol:@protocol(DFMediatorTestA)];
    if (!obj) {
        return;
    }
    UIViewController *VC = [obj findVC:@""];
    if ([VC isKindOfClass:[UIViewController class]]) {
        NSLog(@"准备调用 A");
        [self presentViewController:VC animated:YES completion:nil];
    }
}

@end
